package com.test.controller;

import com.test.pojo.Order;
import com.test.service.OrderService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
public class OrderCtrl {
    @Resource
    private OrderService orderService;
    /*获取订单*/
    @RequestMapping("/getAllOrder")
    public String getAllOrder(Model model){
        List<Order> orderList = orderService.getAllOrder();
        model.addAttribute("orderList",orderList);
        return "OrderList";
    }

    /**
     * 订单状态
     */
    @RequestMapping("/orderDelivery")
    public String orderDelivery(Order order){
        order.setOrderstatus(0);
        orderService.updateOrder(order);
        return "OrderList";
    }



}
